﻿using System;
using System.IO;
using System.Net;
using System.Threading;
using sendfile_server;

namespace socketlib_basic
{
    class Program
    {
        static void Main(string[] args)
        {
            if (args.Length < 3)
            {
                Console.WriteLine("sendfile_client.exe <file> <server> <port>");
                Environment.Exit(-1);
            }

            sendfile_client client = new sendfile_client(args[1], Int32.Parse(args[2]));
            client.SendFile(args[0]);
            //client.Disconnect();
            Console.ReadLine();
            client.Disconnect();

            
            // testSend(args[0]);
            // testSend(args[0], args[1], Int32.Parse(args[2]));

            // sendfile_client_test.StartServerAndClientTest();

            //FileDataMessageUnitTest.TestQueueMsg();
        }

        static void testfileheader(string _path)
        {
            fileinfoHeader_test.Test(_path);
        }



        static void testDns(string[] args)
        {

            if (args.Length < 1)
            {
                Console.WriteLine("dns.exe <ip> ");
                Environment.Exit(-1);
            }

            DNS.RunTest(args[0]);
        }

        static void testSend(string f, string serverip, int port)
        {
            testfileheader(f);
            sendfile_client_test.TestSendFile(f, serverip, port);
        }

        static void testSend()
        {
            testfileheader("phone.txt");
            sendfile_client_test.TestSendFile("phone", "127.0.0.1", 1080);
        }
    }


}
